package com.bootdo.order.service.impl;

import com.bootdo.order.dao.RechargeDao;
import com.bootdo.order.domain.RechargeDO;
import com.bootdo.order.service.RechargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
public class RechargeServiceImpl implements RechargeService {
	@Autowired
	private RechargeDao rechargeDao;
	
	@Override
	public RechargeDO get(Long id){
		return rechargeDao.get(id);
	}
	
	@Override
	public List<RechargeDO> list(Map<String, Object> map){
		return rechargeDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return rechargeDao.count(map);
	}
	
	@Override
	@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,timeout=36000,rollbackFor=Exception.class)
	public int save(RechargeDO recharge){
		return rechargeDao.save(recharge);
	}
	
}
